home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / Magazin / WhatsRelated / Install-WhatsRelated next >
Text File  |  1998-10-27  |  4KB  |  134 lines

  1. ; $VER: Install WhatsRelated 1.0 (28.10.98)
  2. ; Installer script by WHMP (for Changemodes), stolen and modified by Martin Blom
  3. ; Description: Installer script for WhatsRelated ARexx script
  4.  
  5. (set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
  6. (set awv 3)
  7. (set awr 1)
  8. (set #needInst43 "You must use Installer version 43 or greater.  Use the Installer program from your AWeb-II disk.")
  9. (if (< (/ @installer-version 65536) 43)
  10.   (abort #needInst43)
  11. )
  12.  
  13. (set #installing "Installing ")
  14. ; offer to back up a file or drawer
  15. (procedure bumprev #bumpfile #bumptxt
  16.   (if (exists #bumpfile)
  17.     (
  18.       (set bump 1)
  19.       (while (exists (cat #bumpfile "_old" bump) ) (set bump (+ bump 1)) )
  20.       (if
  21.         (askbool
  22.           (default 1)
  23.           (prompt (cat "\n\n\nBackup " #bumpfile " as "
  24.               #bumpfile "_old" bump " ?\n\n\n "
  25.           #bumptxt ) )
  26.           (help
  27.             (cat "\n\n\n\"" #bumpfile "\" is about to be over written.\n"
  28.               "\nYou are being given the chance to back it up."
  29.               " If you are unsure select yes... just in case ;-D ."
  30.             )
  31.           )
  32.         )
  33.         ;        (rename #bumpfile (cat #bumpfile "_old" bump))
  34.         ( (set bdest (cat #bumpfile "_old" bump))
  35.           (copyfiles
  36.             (source #bumpfile)
  37.             (dest bdest)
  38.             (all)
  39.           )
  40.         )
  41.       )
  42.     )
  43.   )
  44. )
  45.  
  46. ;add a line to a settings file
  47.  
  48. (procedure addpref #preffile #preftext
  49.   (foreach "ENVARC:AWeb3" "~(program|browser|gui|network|window|settings)"
  50.     (
  51.       (if (= @each-type 2)
  52.         (run (cat "echo >>ENVARC:AWeb3/" @each-name "/" #preffile " \"" #preftext  "\"") )
  53.       )
  54.     )
  55.   )
  56.   (run (cat "echo >>ENVARC:AWeb3/" #preffile " \"" #preftext  "\"") )
  57. )
  58.  
  59. (set #no-aweb-ii
  60.   (cat "You must have completed the AWeb-II 3.1 installation before "
  61.     "you can install the %s plug-in. No AWeb3: assign has been found."
  62.   )
  63. )
  64. (if (not (exists "AWeb3:" (noreq)))
  65.   (abort (#no-aweb-ii "Utilities"))
  66. )
  67.  
  68. (set @default-dest "AWeb3:")
  69. (bumprev "envarc:aweb3"
  70.   (cat "Your previously SAVED AWeb 3.1 configuration"
  71.   " is in this directory.")
  72. ) ; backup any previous AWeb3 prefs
  73.  
  74. (set menbut
  75.   (askoptions
  76.     (prompt
  77.       "\n\nInstall What's Related as\n"
  78.           )
  79.     (help "\nThe GUI buttons appear on the main AWeb window"
  80. "\nThe ARexx menu is attached to the main AWeb window\n"
  81. "The image popup menu is used to play with individual images from Web pages\n"
  82. "GUI buttons are only available with \n"
  83. "settings-GUI-options-show user buttons on\n")
  84.             (choices "A GUI Button"
  85.               "An ARexx Menu Entry"
  86.               ""
  87.               "A Keyboard Shortcut of \"<ALT>W\"" )
  88.     (default 5)
  89.   )
  90. )
  91. (if(bitand 1 menbut)
  92. (addpref "gui" "UBUT What's RelatedRUN AWeb3:Plugins/WhatsRelated.awebrx")
  93. )
  94. (if(bitand 2 menbut)
  95. (addpref "gui" "AREX 0;AWeb3:Plugins/WhatsRelated.awebrx;What's Related")
  96. )
  97. (if(bitand 8 menbut)
  98.      (addpref "gui" "UKEY 0357 RUN AWeb3:Plugins/WhatsRelated.awebrx")
  99. )
  100. (copyfiles
  101.   (source "WhatsRelated.awebrx")
  102.   (dest (tackon @default-dest "Plugins"))
  103.   (prompt #installing "What's Related")
  104. )
  105.  
  106.  
  107. (if (= @user-level 2)
  108.   ( bumprev "env:aweb3"
  109.     (cat "Your previous ACTIVE AWeb 3.1 configuration"
  110.     " is in this directory.")
  111.   ) ;backup any active prefs
  112. )
  113.  
  114. (delete "env:aweb3/#?" (all))
  115.  
  116. (copyfiles
  117.   (source "ENVARC:AWeb3")
  118.   (dest "ENV:AWeb3")
  119.   (all)
  120. )
  121.  
  122.  
  123. (complete 100)
  124. (set @default-dest "AWeb3:Plugins")
  125.  
  126.  
  127. (exit  "\n\n" @app-name
  128.   " is now installed.\n\n"
  129.   "If this is an update instalation be sure to check your GUI "
  130. " settings for duplicate entries."
  131. "\n"
  132. )
  133.  
  134.